/**
 * Copyright(c) kyle.
 */
package org.example.netty.http;

import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.ChannelFuture;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioServerSocketChannel;

/**
 * 服务器
 *
 * @author kyle
 * @version 1.00.00
 * @since [2020-07-05 10:20]
 * @updateUser [Kyle]
 * @updateRemark [说明本次修改内容]
 * @date [2020-07-05 10:20]
 */
public class TestServer {
    public static void main(String[] args) {
        EventLoopGroup bossGroup = new NioEventLoopGroup(1);
        EventLoopGroup workerGroup = new NioEventLoopGroup();

        ServerBootstrap serverBootstrap = new ServerBootstrap();
        try {
            ChannelFuture lvChannelFuture = serverBootstrap.group(bossGroup, workerGroup)
                    .channel(NioServerSocketChannel.class)
                    .childHandler(null)
                    .bind(6668).sync();

            lvChannelFuture.channel().closeFuture().sync();
        } catch (InterruptedException pE) {
            pE.printStackTrace();
        }
    }
}
